package me.fanchaoo.web.service.impl;

import lombok.extern.slf4j.Slf4j;
import me.fanchaoo.dbo.ArtistDBO;
import me.fanchaoo.dbo.MiniAppConfigDBO;
import me.fanchaoo.dbo.WelcomeConfigDBO;
import me.fanchaoo.enums.EnumFileType;
import me.fanchaoo.exception.BusinessException;
import me.fanchaoo.util.FileTypeUtils;
import me.fanchaoo.util.UUIDUtils;
import me.fanchaoo.util.UserContext;
import me.fanchaoo.web.dao.mapper.ArtistQueryMapper;
import me.fanchaoo.web.dao.mapper.MiniAppConfigQueryMapper;
import me.fanchaoo.web.dao.mapper.WelcomeConfigQueryMapper;
import me.fanchaoo.web.dto.MiniAppConfigDTO;
import me.fanchaoo.web.request.miniAppConfigRequest;
import me.fanchaoo.web.response.BaseResponse;
import me.fanchaoo.web.service.MiniAppConfigService;
import me.fanchaoo.web.service.OssService;
import me.fanchaoo.web.util.oss.OssConfig;
import me.fanchaoo.web.util.oss.OssUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import java.io.IOException;
import java.util.List;

@Slf4j
@Service
public class MiniAppConfigServiceImpl implements MiniAppConfigService {

    @Resource
    private MiniAppConfigQueryMapper miniAppConfigQueryMapper;

    @Resource
    private WelcomeConfigQueryMapper welcomeConfigQueryMapper;

    @Override
    public MiniAppConfigDBO queryMiniAppConfig(miniAppConfigRequest request){
        MiniAppConfigDBO miniAppConfigDBO = miniAppConfigQueryMapper.getByRandomKey(request.getRandomKey());

        return miniAppConfigDBO;
    }

    @Override
    public WelcomeConfigDBO queryWelcomeConfig(miniAppConfigRequest request){
        WelcomeConfigDBO welcomeConfigDBO = welcomeConfigQueryMapper.getByRandomKey(request.getRandomKey());

        return welcomeConfigDBO;
    }


}
